home *** CD-ROM | disk | FTP | other *** search
/ World of Video / World of Video.iso / gfxprograms / conversion / pbmplus / doc / pbmmask.doc < prev    next >
Text File  |  1995-02-13  |  2KB  |  67 lines

  1.  
  2.  
  3.  
  4. pbmmask(1)                  PBM Plus                   pbmmask(1)
  5.  
  6.  
  7.  
  8. NAME
  9.      pbmmask - create a mask bitmap from a regular bitmap
  10.  
  11. SYNOPSIS
  12.      pbmmask [pbmfile]
  13.  
  14. DESCRIPTION
  15.      Reads a portable bitmap as input.  Creates a corresponding
  16.      mask bitmap and writes it out.
  17.  
  18.      The color to be interpreted as "background" is determined
  19.      automatically.  Regardless of which color is background, the
  20.      mask will be white where the background is and black where
  21.      the figure is.
  22.  
  23.      This lets you do a masked paste like this, for objects with
  24.      a black background:
  25.          pbmmask obj > objmask
  26.          pbmpaste < dest -and objmask <x> <y> | pbmpaste -or obj <x> <y>
  27.      For objects with a white background, you can either invert
  28.      them or add a step:
  29.          pbmmask obj > objmask
  30.          pnminvert objmask | pbmpaste -and obj 0 0 > blackback
  31.          pbmpaste < dest -and objmask <x> <y> | pbmpaste -or blackback <x> <y>
  32.      Note that this three-step version works for objects with
  33.      black backgrounds too, if you don't care about the wasted
  34.      time.
  35.  
  36.      You can also use masks with graymaps and pixmaps, using the
  37.      ppmarith tool.  For instance:
  38.          ppmtopgm obj.ppm | pgmtopbm -threshold | pbmmask > objmask.pbm
  39.          ppmarith -multiply dest.ppm objmask.pbm > t1.ppm
  40.          pnminvert objmask.pbm | ppmarith -multiply obj.ppm - > t2.ppm
  41.          ppmarith -add t1.ppm t2.ppm
  42.      An interesting variation on this is to pipe the mask through
  43.      the ppmsmooth script before using it.  This makes the boun-
  44.      dary between the two images less sharp.
  45.  
  46. SEE ALSO
  47.      pbmpaste(1), pnminvert(1), pbm(5), ppmarith(1)
  48.  
  49. AUTHOR
  50.      Copyright (C) 1988 by Jef Poskanzer.
  51.  
  52.      Permission to use, copy, modify, and distribute this
  53.      software and its documentation for any purpose and without
  54.      fee is hereby granted, provided that the above copyright
  55.      notice appear in all copies and that both that copyright
  56.      notice and this permission notice appear in supporting docu-
  57.      mentation.  This software is provided "as is" without
  58.      express or implied warranty.
  59.  
  60.  
  61.  
  62.  
  63. Printed 5/25/90          08 August 1989                         1
  64.  
  65.  
  66.  
  67.